<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>成功提示</title>
</head>
<body>
    <h1>:) <%= msg %></h1>
    <p><span>3</span> 秒后自动跳转至页面</p>
    <script>
        // setTimeout(() => {
        //     location.href = '<%= url %>'
        // }, 3000)
        let t = 3;
        let span = document.querySelector('span');    
        setInterval(() => {
            //修改 span 标签的文本
            span.innerHTML = --t;
            //判断
            if(t <= 0){
                //执行跳转
                location.href = '<%= url %>';
            }
        }, 1000);
    </script>
</body>
</html>